package com.yanqu.road.server.cmd.grandchild.exam;

import com.yanqu.road.pb.grandchild.GrandChildProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.grandson.GrandChildModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_GRAND_CHILD_GET_IMPERIAL_EXAM_RESULT_FROM_CROSS, desc = "请求科举结果  跨服返回")
public class GetImperialExamResultFromCrossCmd extends AbstractCommand {

    private GrandChildProto.ExamResultRewardRespMsg.Builder builder;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        GrandChildProto.ExamResultRewardRespMsg reqMsg = GrandChildProto.ExamResultRewardRespMsg.parseFrom(packet.getBytes());
        builder = reqMsg.toBuilder();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(GrandChildModule.class).getExamResultFromCross(builder);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
